package com.qianli.user.domain.enums;

/**
 * name:认证状态
 * auth:ting.li@qianli-inc.com
 * date:2018/1/10 11:17
 * version: v1.0.0
 **/
public enum  UserAuthStatusEnum {
    INIT(0,"初始化"), 
    AUTHORIZED(1,"认证成功"),
    FAIL(2,"认证失败"),
    CANCEL(3,"取消认证");

    private Integer status;

    private String desc;

    UserAuthStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static UserAuthStatusEnum getEnumByType(Integer type) {
        UserAuthStatusEnum authStatusEnum = null;
        for (UserAuthStatusEnum enumObj : UserAuthStatusEnum.values()) {
            if (enumObj.getStatus().equals(type)) {
                authStatusEnum = enumObj;
                break;
            }
        }

        return authStatusEnum;
    }
}
